import React, {
  Component
} from 'react';
import {
  Link,
  Route,
  Switch
} from 'react-router-dom';

import './App.css';
import Home from './view/Home';
// import New from './view/New'

import Zh_s from './view/Home_zh_s';
import Zh_f from './view/Home_zh_f'


import logo from './static/img/001.png';


class App extends Component {

  componentWillMount() {
    console.log(this)
  }
  componentDidMount() {}
  componentWillReceiveProps(newProps) {}
  shouldComponentUpdate(newProps, newState) {
    return true;
  }
  componentWillUpdate(nextProps, nextState) {}
  componentDidUpdate(prevProps, prevState) {}
  componentWillUnmount() {}
  backTop() {
    console.log('backTop')
    return false;
  }
  render() {
    return (
      <div>
        <header>
          <a onClick={ this.backTop } >
            <img src={logo} alt="logo"  />
          </a>
          <Link to="/">简介</Link>
          <Link to="/">生态构想</Link>
          <Link to="/">技术特点</Link>
          <Link to="/">团队介绍</Link>
          <Link to="/">线路图</Link>
          <ul>
            <li><Link to="/">Engilsh</Link></li>
            <li><Link to="/zh-s">简体中文</Link></li>
            <li><Link to="/zh-f">繁體中文</Link></li>
            {/*<li><Link to="/inbox">inbox</Link></li>*/}
            {/*<li><Link to="/new">New</Link></li>*/}
          </ul> 
        </header>
        <Switch>
          <Route exact path="/" component={ Home }/>
          <Route path="/zh-s" component={ Zh_s }/>
          <Route path="/zh-f" component={ Zh_f }/>
          {/*<Route path="/inbox" component={ Inbox }/>*/}
          {/*<Route path="/new" component={ New }/>*/}
        </Switch>
      </div>
    );
  }
}


// const Message = ({
//   match
// }) => (
//   <div>
//     <h3>new messages</h3>
//     <h3>{match.params.id}</h3>
//   </div>
// )

// const Inbox = ({
//   match
// }) => (
//   <div>
//       <h2>Inbox</h2>
//       <li><Link to={`${match.url}/messages/asdasd`}>inbox/messages</Link></li>
//       <Route path={`${match.url}/messages/:id`} component={Message}/>
//     </div>
// )



export default App;